From cbeadbce20d281be1b5037ab31b5d5832ea329cf Mon Sep 17 00:00:00 2001 From: "kfraser@localhost.localdomain" Date: Mon, 23 Oct 2006 13:10:24 +0100 Subject: [PATCH] [XEN] Fill in runstate_info when virtual address is registered, even when it is registered from the 'wrong' VCPU. Signed-off-by: Keir Fraser --- xen/arch/x86/domain.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index 53d22417dc..3e0a2f82ae 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -378,6 +378,7 @@ arch_do_vcpu_op( case VCPUOP_register_runstate_memory_area: { struct vcpu_register_runstate_memory_area area; + struct vcpu_runstate_info runstate; rc = -EFAULT; if ( copy_from_guest(&area, arg, 1) ) @@ -390,8 +391,15 @@ arch_do_vcpu_op( v->runstate_guest = area.addr.v; if ( v == current ) + { __copy_to_user(v->runstate_guest, &v->runstate, sizeof(v->runstate)); + } + else + { + vcpu_runstate_get(v, &runstate); + __copy_to_user(v->runstate_guest, &runstate, sizeof(runstate)); + } break; } -- 2.30.2